{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Python \t\t3.6\n",
      "Tensorflow \t1.0.0\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Keras \t\t2.0.3\n"
     ]
    }
   ],
   "source": [
    "import sys; print('Python \\t\\t{0[0]}.{0[1]}'.format(sys.version_info))\n",
    "import tensorflow as tf; print('Tensorflow \\t{}'.format(tf.__version__))\n",
    "import keras; print('Keras \\t\\t{}'.format(keras.__version__))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%matplotlib inline \n",
    "\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Extracting ../mnist-data/train-images-idx3-ubyte.gz\n",
      "Extracting ../mnist-data/train-labels-idx1-ubyte.gz\n",
      "Extracting ../mnist-data/t10k-images-idx3-ubyte.gz\n",
      "Extracting ../mnist-data/t10k-labels-idx1-ubyte.gz\n"
     ]
    }
   ],
   "source": [
    "from tensorflow.examples.tutorials.mnist import input_data\n",
    "mnist = input_data.read_data_sets(\"../mnist-data/\", one_hot=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(55000, 784)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mnist.train.images.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA2oAAABpCAYAAABLV9A4A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G+\n709/+hMAzrnKDkxEas5dd90FwOjRo33fpEmTANhxxx2rMiYRadp3330HwI033uj7Xnklt+bBs88+\n69vbb7903962bdv6Pnvet2nTxvd16NAh7mBbmbvvXlok8NJLL/V9VtxN2Uo5rLfeejl977zzThVG\nUhzNqImIiIiIiKSMDtRERERERERSpsUtfbz88st9e6WVVgJgzJgxvm+FFVrcXa66N954A4ARI0b4\nvrffftu3bfnJxx9/7PvuvfdeAM477zzf16lTp7KOU6S57rjjDgDmzp3r++xxPnv27KqMSaS1C09x\nWLhwIQB/+ctffN9hhx0GwNChQ5u8nh122MG3J06cCEBdXZ3vmzZtGgCzZs3yfccddxwAxx9/vO+z\nzxqS3zPPPOPbw4YNA2CfffbxfSuuuGKlhyStyLx58wBYd911qzyS4mhGTUREREREJGVa3PSSFQsB\nOOqoo4Dsb8gkjldffdW3Bw0aBGSfnJkkiW8PGDAAgI022sj32WzEzJkzfd/DDz8MQMeOHcsw4vSy\nb4TXXHNN32czv4sXL/Z9H3zwQc7vPv7447793HPPNXobV111lW+vvfbaOZf/+c9/BmC//fYrdNit\nwvTp06s9hKr47LPPAPjDH/7g+8IZi6b8+Mc/9u2LL74YgPXXXz/i6KQ1+fzzz33b3jfOPPNM3zd5\n8uSc37nkkksA6Nu3r++zWba33nrL92222Wa+bbNrW265pe974oknADj88MN9n82yLViwwPddcMEF\ngGbWlnXfffcBcMUVV/i+//znPwCstdZavq+15vbRRx8Bmc8+AOPGjQOyt5AK/fa3vwVg/PjxZR5d\nbbMCNZB5btvztDnComFWoND+BpWiGTUREREREZGU0YGaiIiIiIhIyrSYpY92cvHXX3/t+3r27Fmt\n4bRYJ554IgCPPvqo77Mlj127dvV94TK+F198EYAjjzzS99mJ23YZwI9+9CMgs7QEYOWVV4429mqx\n+wrZSxzMY489BmRPsdtSEFsaEf5cKFxi2tTegOHPvfnmmzmX2xKftC99vPXWWwG4+eabfd9ZZ50F\nQK9evSoyBltC1dI89dRTvj1y5EgAXnvtNd+X7/G10047AfD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oVSbLkoLK2m1BjbGw1gn332AbC14TlseWh4Yvzll19e/GDzSGOm5WTFgsJlz2HR\nghhaW6aFsiW6TT0/mpIn117OucG0klz32GOP6NdZjUw7dOjg22effTaQWRIfOvHETP0CWwYZFqGy\nolhhAbCLL74YgB133NH3hUUECl0mHr6eN9eymb7xxhuk8XFqS5DDPezs72GFKyCzNN/er6qhtb2m\nWhGmr776yveFf5MYWkOm8+bNy2mntahIIVUfnwIaK3kW/92hFejXr19OxTPn3KdJknyEMi2KMo1P\nmcanTMtj2Vydc7OTJLFvgZRrEZRpfMtm2qdPH2bMmKFMS6DX1PiUaboU9/WltFjhSen2rWV40qqV\nLp4/f77vs4ILYeGL8Elu31RaoRaAX//610Bps2hpN3bsWACeffZZ3zdgwAAAFixY4Pvsm+B7773X\n933xxRdAdll4m7mETGGWfv36xR52q7fLLrv49qOPPgpkzyBLfEuWLAHgu+8y56vHKNjUUoQFMJ54\n4gkANt10U99X6nYpadGmTRvftvef8D3i7bffBjLbuwBssMEGOT9n70XhY2jFFVcsw4hbJsvK3sMg\n8xgMi6hUcyatNendu7dvT5s2rYojqW077LCDb4efYdNO74QiIiIiIiIpowM1ERERERGRlNHSR2lU\nx44dAZgwYYLvs7YtvwFs086swgvhMkc7GTU8ibs12GSTTYDs5SO2ZCdc0pjPyiuvDGTvaxdeTyl7\nzUnThg0blrctcay11lo5fVOnTgWy9wvacMMNKzWk1Hv55Zd924oIhEsfiy3Ckma2DHLQoEE5lx19\n9NGVHk6rd9FFF1V7CK1W+Fw39vkMYP3116/kcGrW008/Xe0hFEUzaiIiIiIiIinT8r6Gk4ro379/\nTt/AgQOrMJL0uuyyy4BMqWOAe+65B8guu28zb4MHD/Z9Y8aMAaCurq7cwxSpqAsvvBCA+vp639ej\nRw8gveWRq+2FF17I6cs30yQiLc/BBx/s29dccw0AZ511lu/beOONKz4mqRzNqImIiIiIiKSMDtRE\nRERERERSRksfRcqkXbt2AJx++um+L2yLtEYdOnQAMnvUSfNYkZWRI0d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y+ac84B1wCvJklyQXDR3cDQ\nhvZQ4B8VHpoyjU+ZxlezmUJqc1Wm8SnT+JRpfMq0PGo2V2UaX6oyjVWVpJD/gMEsrZwyBzilkrdd\n4rj7sXR680XghYb/BgNrAo8AbwIPA2tUYWzKVJkq01aYqzJVpspUmSpT5apMW3amrmFAIiIiIiIi\nkhIqJiIiIiIiIpIyOlATERERERFJGR2oiYiIiIiIpIwO1ERERERERFJGB2oiIiIiIiIpowM1ERER\nERGRlNGBmoiIiIiISMr8PzT+1wrcrWcKAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x119ea24a8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(15,5))\n",
    "for i in list(range(10)):\n",
    "    plt.subplot(1, 10, i+1)\n",
    "    pixels = mnist.test.images[i+100]\n",
    "    pixels = pixels.reshape((28, 28))\n",
    "    plt.imshow(pixels, cmap='gray_r')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import tensorflow as tf\n",
    "import tensorlayer as tl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Set parameters\n",
    "training_iteration = 10\n",
    "batch_size = 250\n",
    "display_step = 5\n",
    "\n",
    "FLAGS = None"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# TF graph input\n",
    "x = tf.placeholder('float', [None, 784]) # mnist data image of shape 28*28=784\n",
    "y = tf.placeholder('float', [None,10]) # 0-9 digits recognition => 10 classes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  [TL] InputLayer  input_layer: (?, 784)\n",
      "  [TL] DenseLayer  relu1: 512 relu\n",
      "  [TL] DropoutLayer drop1: keep:0.750000 is_fix:False\n",
      "  [TL] DenseLayer  relu2: 512 relu\n",
      "  [TL] DropoutLayer drop2: keep:0.750000 is_fix:False\n",
      "  [TL] DenseLayer  output_layer: 10 identity\n"
     ]
    }
   ],
   "source": [
    "network = tl.layers.InputLayer(x, name='input_layer')\n",
    "network = tl.layers.DenseLayer(network, n_units=512,act = tf.nn.relu, name='relu1')\n",
    "network = tl.layers.DropoutLayer(network, keep=0.75, name='drop1')\n",
    "network = tl.layers.DenseLayer(network, n_units=512,act = tf.nn.relu, name='relu2')\n",
    "network = tl.layers.DropoutLayer(network, keep=0.75, name='drop2')\n",
    "network = tl.layers.DenseLayer(network, n_units=10,act = tl.activation.identity, name='output_layer')\n",
    "\n",
    "# unscaled output (log probabilities)\n",
    "y_hat = network.outputs\n",
    "\n",
    "# scaled output\n",
    "y_out = tf.nn.softmax(y_hat)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=y,logits=y_hat))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "train_params = network.all_params\n",
    "with tf.name_scope(\"train\") as scope:\n",
    "    # Gradient descent\n",
    "    optimizer = tf.train.AdamOptimizer()\n",
    "    learn     = optimizer.minimize(cost, var_list=train_params)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Initializing the variables\n",
    "init = tf.global_variables_initializer()\n",
    "\n",
    "# Merge all summaries into a single operator\n",
    "merged_summary_op = tf.summary.merge_all()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Launch the graph\n",
    "sess = tf.InteractiveSession()\n",
    "sess.run(init)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Change this to a location on your computer\n",
    "summary_writer = tf.summary.FileWriter('./tensorboard/tf', graph=sess.graph)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Test the model, Calculate accuracy\n",
    "prediction = tf.equal(tf.argmax(y_hat, 1), tf.argmax(y, 1))\n",
    "acc = tf.reduce_mean(tf.cast(prediction, tf.float32))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Start training the network ...\n",
      "Epoch 1 of 10 took 3.713975s\n",
      "   val loss: 0.130056\n",
      "   val acc: 0.960200\n",
      "Epoch 5 of 10 took 4.119508s\n",
      "   val loss: 0.065117\n",
      "   val acc: 0.979400\n",
      "Epoch 10 of 10 took 4.020873s\n",
      "   val loss: 0.067738\n",
      "   val acc: 0.980500\n",
      "Total training time: 41.109480s\n"
     ]
    }
   ],
   "source": [
    "# train the network\n",
    "tl.utils.fit(sess, network, learn, cost, mnist.train.images, mnist.train.labels, x, y,\n",
    "             acc=acc, batch_size=batch_size, n_epoch=training_iteration, print_freq=display_step, \n",
    "             X_val=mnist.test.images, y_val=mnist.test.labels, eval_train=False)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Start testing the network ...\n",
      "   test acc: 0.980500\n"
     ]
    }
   ],
   "source": [
    "# evaluation\n",
    "tl.utils.test(sess, network, acc, mnist.test.images, mnist.test.labels, x, y, batch_size=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{<tf.Tensor 'Placeholder_2:0' shape=<unknown> dtype=float32>: 1,\n",
       " <tf.Tensor 'Placeholder_3:0' shape=<unknown> dtype=float32>: 1}"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dp_dict = tl.utils.dict_to_one( network.all_drop )\n",
    "dp_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{0: 5.2470352e-07,\n",
       " 1: 1.4410477e-09,\n",
       " 2: 6.4901751e-09,\n",
       " 3: 9.6050971e-12,\n",
       " 4: 1.8693913e-09,\n",
       " 5: 2.8257659e-08,\n",
       " 6: 0.99999952,\n",
       " 7: 4.9972051e-11,\n",
       " 8: 1.3550721e-09,\n",
       " 9: 1.0239229e-11}"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# test item #100 is a \"six\"\n",
    "pixels = mnist.test.images[100]\n",
    "\n",
    "feed_dict = {x:[pixels]}\n",
    "feed_dict.update(dp_dict)\n",
    "\n",
    "result = sess.run(y_out, feed_dict=feed_dict)\n",
    "dict(zip(range(10), result[0]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def test_render(pixels, result, truth):\n",
    "    #pixels, result and truth are np vectors\n",
    "    plt.figure(figsize=(10,5))\n",
    "    plt.subplot(1, 2, 1)\n",
    "    pixels = pixels.reshape((28, 28))\n",
    "    plt.imshow(pixels, cmap='gray_r')\n",
    "\n",
    "    plt.subplot(1, 2, 2)\n",
    "    \n",
    "    #index, witdh\n",
    "    ind = np.arange(len(result))\n",
    "    width = 0.4\n",
    "\n",
    "    plt.barh(ind,result, width, color='orange', edgecolor='k', hatch=\"/\")\n",
    "    plt.barh(ind+width,truth,width, color='g', edgecolor='k')\n",
    "    plt.yticks(ind+width, range(10))\n",
    "    plt.margins(y=0)\n",
    "\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlMAAAEyCAYAAADeAVWKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHPRJREFUeJzt3XuQXnWd5/HPh4Qg0OwQoSfbzS0IQSeGS6wuYBZHGUEL\nULkIKpEwCNS0VUu4bXblMkvB7roWwwgMU8WorSDsCLiKMKZmMlxkcFgtZe1AJIEIAhNC0k0Sl4HQ\n6g65fPeP5wSa3nSfk5ynn985Oe9XVSrdz/PNeT79ELo/OZffcUQIAAAAO2aX1AEAAADqjDIFAABQ\nAmUKAACgBMoUAABACZQpAACAEihTAAAAJVCmAAAASqBMAQAAlECZAgAAKGFq6gAAUAd77LFHzJ49\nO3UMAB20ZMmSX0dEd96cuZ0MAOSzHXy/BJrF9pKI6Mub4zAfgMayfant5baftn1Z6jwA6okyBaCR\nbM+R9KeSjpZ0pKRP2D40bSoAdUSZAtBUfyDp8Yj4bURskvRPkj6VOBOAGqJMAWiq5ZL+yPY+tveQ\ndIqkAxJnAlBDXM0HoJEiYoXtP5f0kKTfSFoqafPoGdv9kvoTxANQI1zNBwCSbH9Z0uqI+Otxnudq\nPqBhil7Nx54pAI1l+/cjYp3tA9U6X+rY1JkA1E9Hy9S+++4bM2fO7ORLAkis6KJ3iXzf9j6SNkq6\nKCJeSx0IQP2UKlO2T5J0i6Qpkr4ZEddPND9z5kwNDg6WeUkANWP7pdQZxhMRf5Q6A4D62+Gr+WxP\nkXSrpJMlzZY0zzb3WgCwU+rq6kodAUBFlVka4WhJz0fEixHxpqTvSDqtPbEAoFpGRkZSRwBQUWXK\n1H6SXh71+ersMQAAgMaY9EU7bffbHrQ9uH79+sl+OQAAgI4qU6bW6J2rBe+fPfYOETEQEX0R0dfd\nXdULegAAAHZMmTL1c0mzbB9se5qksyUtak8sAACAetjhpREiYpPtBZIeVGtphNsj4um2JQMAAKiB\nUutMRcRi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mOiLjR9h9K+hvbc7JFfxuJPVMA8LYid2d4a8b2VLUOc/yfjqTLV+juErZPlPRn\nkk6NiH/tULai8r6GvSTNkfQj2yslHStpUYVOQi/y32C1pEURsTEi/lnSc2qVqyookv9CtdbSU0T8\nVNK71FojsC7afhcWyhQAvK3I3RlGr3B/lqR/jOos2Jeb3/ZcSV9Xq0hV6VydrSb8GiLi9YjYNyJm\nRsRMtc77OjUiBtPE/f8U+Tv0t2rtlZLtfdU67PdiJ0NOoEj+VZJOkCTbf6BWmVrf0ZTlLJL0J9lV\nfcdKer3sIsUc5gOATERssr1A0oN6++4MT9v+r5IGI2KRWrfj+Rvbz6t1kuvZ6RK/U8H8fyGpS9L3\nsvPmV0XEqclCj1Hwa6isgvkflPQx289I2izpP0VEJfZuFsy/UNI3bF+u1snon6/QPyjecUeN7Lyu\nayXtKkkR8TW1zvM6RdLzkn4r6fzSr1mhrx8AAKB2OMwHAABQAmUKAACgBMoUAABACZQpAACAEihT\nAAAAJVCmAAAASqBMAQAAlPD/AFGkxY1HB7ICAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x123386d68>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import random\n",
    "i = random.randint(0,mnist.test.images.shape[0])\n",
    "\n",
    "pixels = mnist.test.images[i]\n",
    "truth  = mnist.test.labels[i]\n",
    "\n",
    "feed_dict = {x:[pixels]}\n",
    "feed_dict.update(dp_dict)\n",
    "result = sess.run(y_out, feed_dict=feed_dict)[0]\n",
    "\n",
    "test_render(pixels, result, truth)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "### What went wrong?\n",
    "pixels = mnist.test.images\n",
    "truth = mnist.test.labels\n",
    "\n",
    "feed_dict = {x:pixels}\n",
    "feed_dict.update(dp_dict)\n",
    "result = sess.run(y_out, feed_dict=feed_dict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Incorrect predictions: 195\n"
     ]
    }
   ],
   "source": [
    "acc = result.argmax(axis=1) == truth.argmax(axis=1)\n",
    "incorrect = np.argwhere(acc==False).flatten()\n",
    "\n",
    "print(\"Incorrect predictions: {}\".format(len(incorrect)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABIEAAABdCAYAAAAyhXaGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcHGWdx/FPYciKQOQ0iyFcigoIBEiIiLIIYQHRgBsE\nuZErUVECRA2HqyyiiIAE5RAW5FIBkd2AspyCHLsiCYhAIAmEcBnCoZJEQCKp/SPz7ae65qmZnpnu\n6eru7/v1ymsyPT3d1b95uqq6nt/z+yVpmmJmZmZmZmZmZu1thWZvgJmZmZmZmZmZNZ4vApmZmZmZ\nmZmZdQBfBDIzMzMzMzMz6wC+CGRmZmZmZmZm1gF8EcjMzMzMzMzMrAP4IpCZmZmZmZmZWQfwRSAz\nMzMzMzMzsw4woItASZLsliTJ7CRJnkySZGq9NqodODZxjksxxybOcSnm2MQ5LsUcmzjHpZhjE+e4\nFHNs4hyXOMelmGMT57gMXJKmaf9+MUneAcwBdgGeBx4A9kvTdFb9Nq81OTZxjksxxybOcSnm2MQ5\nLsUcmzjHpZhjE+e4FHNs4hyXOMelmGMT57jUx0AuAm0HfCtN0127vj8BIE3T7xb9zlprrZVusMEG\n/Xq+VrJkyRJmz569NE3TodB7bBwXjxmPmTiPmWJz585l0aJFt9a6D+6UuHjMFPOYifOYKeYxE+cx\nU8xjJs5jJm7JkiXMmzePt956KwHHJctjJs5jpmczZ858JU3TtXu735ABPMcI4LnM988DY/N3SpLk\nKOAogPXWW48ZM2YM4Clbw3XXXcdnP/vZ1zI3dY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fFsXFcHJuy/XNcBi8ujk3xv8HKBNoWeDJN03lpmr4FXA3sOUjPXTdpmi5I0/TBrv8vBh4HRgzw\nYVs+No5LMccmznEp5tjEOS7FHJs4x6WYYxPnuBRzbOIcl2KOTZzjEteguIBjEzVYF4FGAM9lvn+e\n+vxRmyZJkg2ArYD7u246OkmSPyZJcmmSJKv34aHaKjaOSzHHJs5xKebYxDkuxRybOMelmGMT57gU\nc2ziHJdijk2c4xJXx7iAYxPlwtD9kCTJKsAvgclpmi4CLgDeB4wCFgBnNXHzmsZxKebYxDkuxRyb\nOMelmGMT57gUc2ziHJdijk2c41LMsYlzXOIcl2L1jM1gXQR6ARiZ+X7drttaTpIkK7I8+D9N0/R6\ngDRNF6Zp+naapsuAi1medlartoiN41LMsYlzXIo5NnGOSzHHJs5xKebYxDkuxRybOMelmGMT57jE\nNSAu4NhEDdZFoAeAjZMk2TBJkqHA54AbBum56yZJkgS4BHg8TdOzM7evk7nbZ4BH+/CwLR8bx6WY\nYxPnuBRzbOIcl2KOTZzjUsyxiXNcijk2cY5LMccmznGJa1BcwLGJGlK/zSuWpuk/kiQ5GriF5RW6\nL03T9LHBeO462x44CHgkSZI/dN12IrBfkiSjgBSYD0ys9QHbJDaOSzHHJs5xKebYxDkuxRybOMel\nmGMT57gUc2ziHJdijk2c4xJX97iAY1MkSZe3GjMzMzMzMzMzszbmwtBmZmZmZmZmZh3AF4HMzMzM\nzMzMzDqALwKZmZmZmZmZmXUAXwQyMzMzMzMzM+sAvghkZmZmZmZmZtYBfBHIzMzMzMzMzKwD+CKQ\nmZmZmZmZmVkH8EUgMzMzMzMzM7MO8P8QiD65mX37PgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x12331cf98>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(20,5))\n",
    "plt_idx = 1\n",
    "for i in list(incorrect[:16]):\n",
    "    plt.subplot(1, 16, plt_idx)\n",
    "    pixels = mnist.test.images[i]\n",
    "    pixels = pixels.reshape((28, 28))\n",
    "    plt.imshow(pixels, cmap='gray_r')\n",
    "    plt_idx += 1\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlMAAAEyCAYAAADeAVWKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHeBJREFUeJzt3XuQnXWd5/HPh0BUbIUgmdgdCFHJgCwzgLYIi+NwiSyw\nlIzLaBEvwBRlKEuGMN4KYamAOgvuAiq1jNJilosBVhSVYqNEMSxqSZYORgw3ZTGRpDsXlmtraQx8\n949zIm2Tzu/pPKfP73nyvF9VXek+55vnfPokpD88l9/jiBAAAAB2zC65AwAAANQZZQoAAKAEyhQA\nAEAJlCkAAIASKFMAAAAlUKYAAABKoEwBAACUQJkCAAAogTIFAABQwq65AwBAHey+++5x0EEH5Y4B\noItWrFjxZERMT82Z28kAQJrt4N9LoFlsr4iI/tQch/kANJbtBbZX2X7Q9nm58wCoJ8oUgEayfbCk\nD0s6XNIhkk62vX/eVADqiDIFoKneLGl5RPw+IrZI+t+S/lPmTABqiDIFoKlWSfo726+zvbukkyTt\nmzkTgBriaj4AjRQRD9v+vKSlkn4naaWkF0bP2J4vaX6GeABqhKv5AECS7f8iaW1E/Ns4z3M1H9Aw\nRa/mY88UgMay/VcRsdH2LLXOlzoidyYA9dPVMrX33nvH7Nmzu/mSADIruuhdJt+y/TpJf5L00Yh4\nJncgAPVTqkzZPkHSlyRNkXRtRFy2vfnZs2drcHCwzEsCqBnba3JnGE9E/F3uDADqb4ev5rM9RdLV\nkk6UdJCkeba51wKAnVJPT0/uCAAqqszSCIdLeiwiHo+IzZJukXRKZ2IBQLWMjIzkjgCgosqUqZmS\nnhj19dr2YwAAAI0x6Yt22p5ve9D24KZNmyb75QAAALqqTJlap79cLXif9mN/ISIGIqI/I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k67Ttu+osdWJkua0P+artTRMKZQpAHjJ\n4ZIei4jHI2KzpFsknTJm5hRJ17c//6ak49pXSVZBMn9ELIuI37e/vFetpWmqpMifgSR9Vq0i+4du\nhiugSP4PS7p668K47eV2qqJI/pD02vbne0ga6mK+pIi4R9L2Lvo5RdIN0XKvpD3HXNE8YZQpAHjJ\ntu7OMHO8mYjYIulZSa/rSrq0IvlHO0vS9yY10cQlv4f2YZl9I+J/dTNYQUX+DP5a0l/b/qnte21v\nby9KtxXJf7GkD9peK2mJpH/uTrSOmeh/J0m5bicDAMjI9gcl9Uv6+9xZJsL2LpKulHRm5ihl7KrW\nIaaj1dozeI/tv4mIZ7KmKm6epOsi4or2vXZvtH1we9HfRmLPFAC8pMjdGf48Y3tXtQ5z/L+upEsr\ndHcJ23MlXSjp3RHxxy5lKyr1PbxG0sGS7m7ffP4ISbdX6CT0In8GayXdHhF/iojfSPqVWuWqCork\nP0uttfQUET+T9Eq11gisi47fhYUyBQAvKXJ3htEr3P+jpB9FdRbsS+a3fZika9QqUlU6V2er7X4P\nEfFsROwdEbMjYrZa5329OyIG88R9mSJ/h76j1l4p2d5brcN+j3cz5HYUyf9bScdJku03q1WmNnU1\nZTm3Szq9fVXfEZKeLbtIMYf5AKAtIrbYPkfSnXrp7gwP2v6MpMGIuF2t2/HcaPsxtU5yPS1f4r9U\nMP9/k9Qj6db2efO/jYh3Zws9RsHvobIK5r9T0vG2H5L0gqRPRkQl9m4WzP9xSV+1/S9qnYx+ZoX+\nh+Iv7qjRPq9roaTdJCkivqLWeV4nSXpM0u8l/VPp16zQ9w8AAFA7HOYDAAAogTIFAABQAmUKAACg\nBMoUAABACZQpAACAEihTAAAAJVCmAAAASvj/DUvQrDpFGOAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x11a592c18>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "i = random.choice(list(incorrect))\n",
    "\n",
    "pixels = mnist.test.images[i]\n",
    "truth  = mnist.test.labels[i]\n",
    "\n",
    "feed_dict = {x:[pixels]}\n",
    "feed_dict.update(dp_dict)\n",
    "result = sess.run(y_out, feed_dict=feed_dict)[0]\n",
    "\n",
    "test_render(pixels, result, truth)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Close the Session when we're done.\n",
    "sess.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
